div:first-of-type{ background: blue;}
div:last-of-type{ background: red;}

div:nth-of-type(2n+1){ background: red;}
div:nth-of-type(2n){ background: blue;}
div:nth-of-type(odd){ color: black;}
div:nth-of-type(even){ color: white;}
div:nth-of-type(3){ border: solid 1px yellow;}

div:nth-last-of-type(2n+1){ background: red;}
div:nth-last-of-type(2n){ background: blue;}
div:nth-last-of-type(odd){ color: black;}
div:nth-last-of-type(even){ color: white;}
div:nth-last-of-type(3){ border: solid 1px yellow;}
